from app.models.simulation_result_total_map import SimulationResultTotalMap
from app.schemas.simulation_result_total_map import SimulationResultTotalMapCreate


async def create_total_map(data: SimulationResultTotalMapCreate):
    return await SimulationResultTotalMap.create(**data.dict())


async def list_total_maps_by_total_id(total_id: int):
    return await SimulationResultTotalMap.filter(simulation_result_total_id=total_id).all()


async def list_total_maps_by_result_id(result_id: int):
    return await SimulationResultTotalMap.filter(simulation_result_id=result_id).all()